<?php
namespace App\Providers;

use Illuminate\Support\ServiceProvider;

use Illuminate\Database\Eloquent\Relations\Relation;

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        \Illuminate\Support\Facades\View::addNamespace('admin', resource_path('views/admin'));
    }
    public function boot()
    {
        // 多态关联映射
        Relation::enforceMorphMap([
            '1' => 'App\Models\Operation\WarehouseEntry',
            '2' => 'App\Models\Operation\WarehouseExit',
            '3' => 'App\Models\Operation\LogisticInquiry',
            '4' => 'App\Models\Operation\KeyDelivery',
            '5' => 'App\Models\Operation\KeyDuplication',
            '6' => 'App\Models\Operation\ItemSendback',
            '7' => 'App\Models\Operation\VehicleRepair',
        ]);
    }
}
